package cn.otrue.patienthealthmanager.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import cn.otrue.patienthealthmanager.R;
import cn.otrue.patienthealthmanager.adapter.DoctorAddAdpater;

/**
 * 找医生->添加医生
 * 
 * @author G
 * 
 */
public class DoctorAddActivity extends BaseActivity {

	private List<Map<String, String>> add;
	private ListView lv_doctor_add;

	private ImageView iv_add_a;
	private View rootView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_doctor_add);
		initView();
	}

	private void initView() {
		getData();
		lv_doctor_add = (ListView) findViewById(R.id.lv_doctor_add);
		lv_doctor_add.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {

				Intent intent = new Intent();
				intent.setClass(rootView.getContext(),
						DoctorParticularsActivity.class);
				startActivity(intent);

			}
		});
		DoctorAddAdpater adapter = new DoctorAddAdpater(this, add);
		lv_doctor_add.setAdapter(adapter);

	}

	private void getData() {
		add = new ArrayList<Map<String, String>>();

		for (int i = 0; i < 5; i++) {
			Map<String, String> map = new HashMap<String, String>();
			map.put("one", "赫xx医生");
			map.put("two", "北京协和医院 心脑血管主任");
			map.put("shree", "主治 心血管 糖尿病");

			add.add(map);

		}

	}

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub

	}

}
